# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Peter Shkenev <santurysim@gmail.com>
pkgname=py3-distlib
pkgver=0.3.7
pkgrel=2
pkgdesc="Distribution utilities"
url="https://github.com/pypa/distlib"
arch="noarch"
license="PSF-2.0"
depends="python3"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
subpackages="$pkgname-pyc"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/pypa/distlib/archive/refs/tags/$pkgver.tar.gz
	10-remove-funky-test.patch
    "
builddir="$srcdir/distlib-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	PYTHONHASHSEED=0 python3 -m unittest discover tests
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/distlib*.whl

	rm "$pkgdir"/usr/lib/python3*/site-packages/distlib/*.exe
}

sha512sums="
33806fd953c4b185eaa69c7d0f0cdad9ea71be73d26f0585cefd4a332edbcc3c6287b3bce024858d5d15626311f2567474b19b6366f80b2336d9b39691c6fe31  py3-distlib-0.3.7.tar.gz
c77d21ec087abe6dbd80bcfc20f3b26d881ff7f42e2ba37185fe6315934afda5be23eed7cc522ecf01d696ba031ed83a2a43e87cd7be6ee7a7963eaa95afebe7  10-remove-funky-test.patch
"
